<?php

namespace App\Http\Requests\Admin\Live;

use App\Http\Requests\BaseFormRequest;

class AnchorSaveFormRequest extends BaseFormRequest
{
    protected function passedValidation()
    {
        $images = $this->get('images');
        if (!empty($images)) {
            $this->offsetSet('images', json_decode($images, true));
        } else {
            $this->offsetSet('images', []);
        }
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'nickname' => [
                'required'
            ]
        ];
    }
}
